project "Dream"
	kind "SharedLib"
	language "C++"
	staticruntime "off"

	disablewarnings { "4251", "4244" }

	targetdir ("%{wks.location}/build/bin/" .. outputdir .. "/%{prj.name}")
	objdir ("%{wks.location}/build/bin-int/" .. outputdir .. "/%{prj.name}")

	pchheader "dmpch.h"
	pchsource "src/dmpch.cc"

	files
	{
        "premake5.lua",
		"src/**.h",
		"src/**.cc",
		"src/**.cpp",

		"%{prj.name}/vendor/glm/glm/**.hpp",
		"%{prj.name}/vendor/glm/glm/**.inl",
		"%{IncludeDir.stb_image}/**.h",
		"%{IncludeDir.stb_image}/**.cc",
	}

	includedirs
	{
		"src",
		"vendor/spdlog/include",
		"Dream/vendor",
		"%{IncludeDir.GLFW}",
		"%{IncludeDir.GLad}",
		"%{IncludeDir.ImGui}",
		"%{IncludeDir.glm}",
		"%{IncludeDir.stb_image}",
		"%{IncludeDir.entt}",
		"%{IncludeDir.Vulkan}/include"
	}

	links
	{
		"GLFW",
		"GLad",
		"ImGui",
		"vulkan-1",
		"opengl32.lib",
	}
	libdirs
	{
		"%{IncludeDir.Vulkan}/Lib"
	}
	defines "IMGUI_BUILD_DLL"
	filter "system:windows"
		cppdialect "C++17"
		systemversion "latest"

		defines
		{
			"DM_BUILD_DLL",
			"GLFW_INCLUDE_NONE",
			"_CRT_SECURE_NO_WARNINGS",

		}

		postbuildcommands
		{
			("mkdir \"%{wks.location}/build/bin/" .. outputdir .. "/Sandbox\""),
			("{COPY} %{cfg.buildtarget.relpath} %{wks.location}/build/bin/" .. outputdir .. "/Sandbox"),
			("{COPY} %{cfg.buildtarget.relpath} %{wks.location}/build/bin/" .. outputdir .. "/Dream-Editor")
		}
		
		buildoptions { "/utf-8" }

	filter "configurations:Debug"
		defines "DM_DEBUG"
		runtime "Debug"
		symbols "On"
		
	filter "configurations:Release"
		defines "DM_RELEASE"
		runtime "Release"
		optimize "On"

	filter "configurations:Dist"
		defines "DM_DIST"
		runtime "Release"
		optimize "On"